{extends file='../base.html'}
{block name=global}
<script type="text/javascript">
var winWidth = $(window).width();
var heiHeght = $(window).height();
</script>
<div id="gloBox" class="{$default_skin}">
    <div id="gloTop" class="clearfix">
        <div id="loadLine"><i class="ll"></i><i class="lr"></i></div>
        <div class="gtLeft clearfix">
            <div class="logo {if !$dev.cms_logo}text{/if}">{if $dev.cms_logo}<img src="{$absroot}{$dev.cms_logo}" alt="{$dev.cms_title}"/>{else}{$dev.cms_title}{/if}</div>
            <div class="menuBar" >
                <ul class="list">
                    <li class="bar_line bar_top"></li>
                    <li class="bar_line bar_mid"></li>
                    <li class="bar_line bar_foot"></li>
                </ul>
            </div>
        </div>
        {$cms_menu=adminmenu('nav')|default:[]}
        <div class="topMenu" id="topMenu">
            <ul class="grid">
                {foreach $cms_menu as $level0_id => $level0}
                {$is_top_display=true}
                {if !config('app_debug') && adminmenu($level0_id,'is_debug')}{$is_top_display=false}{/if}
                {if $is_top_display}
                {$is_power=true}
                {if (adminmenu($level0_id,'power_tree_id') and !in_array(adminmenu($level0_id,'power_tree_id'), $powers)) and !$is_super_power}{$is_power = false}{/if}
                {if $is_power}
                <li {if $level0@first}class="current"{/if}>{adminmenu($level0_id,'title')}</li>
                {/if}
                {/if}
                {/foreach}
                <li><i class="fa-globe fa"></i></li>
            </ul>
        </div>        
        
        <div class="gtRght">
            <ul class="layui-nav list" lay-filter="">
                <li class="layui-nav-item circle gohome first"><a class="tooltip" data-tip-text="访问前台" data-tip-type="3" href="{url('Home/Index/index')}" target="_blank"><i class="fa fa-home"></i></a></li>
                <li class="layui-nav-item circle"><a class="tooltip javascript" rel="full_screen" data-tip-text="F11全屏" data-tip-type="3" href="javascript:void(0);"><i class="fa fa-arrows "></i></a></li>
                <li class="layui-nav-item circle"><a class="tooltip javascript" rel="simple_clear" data-tip-text="清除缓存" data-tip-type="3" href="{url('Tool/clearCache')}"><i class="fa fa-remove" style="margin: -7px 0 0 -5px;"></i></a></li>
                <li class="layui-nav-item circle"><a target="_blank" class="tooltip" data-tip-text="培训手册" data-tip-type="3" href="{$dev.manual_url}"><i class="fa fa-book" style="margin: -7px 0 0 -7px;"></i></a></li>
                <li class="layui-nav-item circle skin-down"><a  href="javascript:void(0);"><i class="fa fa-yelp" style="margin: -7px 0 0 -6px;"></i></a>
                    <div class="skin-show clearfix">
                        <a data-skin="default" rel="change_skin"  style="background: #009688;" class="javascript"></a>
                        <a data-skin="green" rel="change_skin"  style="background: rgba(0,166,90,1);" class="javascript"></a>
                        <a data-skin="pink"  rel="change_skin" style="background: rgba(250,96,134,1);" class="javascript"></a>
                        <a data-skin="blue"  rel="change_skin" style="background: rgba(0,192,239,1);" class="javascript"></a>
                        <a data-skin="red"   rel="change_skin" style="background: rgba(250,42,0,1);" class="javascript"></a>
                    </div>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" class="admin-user" >
                        <span class="admin-user-headpic"><img  src="{$root}{$login.Member.headimg|default:'images/admin/default_headimg.png'}" alt=""/></span><span class="admin-user-name en-font">{$login.Member.nickname|default:$login.username}</span>
                     </a>
                    <dl class="layui-nav-child">
                        <i class="i"></i>
                        <dd><a href="{url('User/modify',['id'=>$login.id])}" class="new_tab" data-icon="fa-user"><i class="fa fa-pencil" aria-hidden="true"></i>修改密码</a></dd>
                        <dd><a href="" class="javascript" rel="lockScreen"><i class="fa fa-lock" aria-hidden="true" style="padding-right: 2px;padding-left: 2px;"></i>锁屏(Alt+L)</a></dd>
                        <dd class="bt"><a href="{url('User/logout')}"><i class="fa fa-sign-out" aria-hidden="true"></i>注销登录</a></dd>
                    </dl>
                </li>
            </ul>
        </div>        
    </div>
    <div id="gloLeft" class="sizing">
        <div class="leftbg"></div>
        <div id="leftBar">
            
            {foreach $cms_menu as $level0_id => $level0}
            {$is_top_display=true}
            {if !config('app_debug') && adminmenu($level0_id,'is_debug')}{$is_top_display=false}{/if}
            {if $is_top_display}
            {$is_top_power=true}
            {if (adminmenu($level0_id,'power_tree_id') and !in_array(adminmenu($level0_id,'power_tree_id'), $powers)) and !$is_super_power}{$is_top_power = false}{/if}
            {if $is_top_power}            
            <ul class="list gloMenu {if !$level0@first}hidden{/if}">
                {foreach $level0 as $level1_id => $level1}
                {$is_display=true}
                {if !config('app_debug') && adminmenu($level1_id,'is_debug')}{$is_display=false}{/if}
                {if $is_display}
                {$is_power=true}
                {if (adminmenu($level1_id,'power_tree_id') and !in_array(adminmenu($level1_id,'power_tree_id'), $powers)) and !$is_super_power}{$is_power = false}{/if}
                {if $is_power}
                <li>
                    <div class="navT">                    
                        <a href="{url(adminmenu($level1_id,'url'))}"><i data-icon="{adminmenu($level1_id,'icon')}" class="fa {adminmenu($level1_id,'icon')}   animated" style="color: rgb({rand(50,200)},{rand(50,200)},{rand(50,200)}); "></i><cite>{adminmenu($level1_id,'title')}</cite></a>
                    </div>
                    {if $level1}
                    <div class="navC">
                        <ul class="list">
                            {foreach $level1 as $level2_id => $level2}
                            {$is_display1=true}
                            {if !config('app_debug') && adminmenu($level2_id,'is_debug')}{$is_display1=false}{/if}
                            {if $is_display1}
                            {$is_power1=true}
                            {if (adminmenu($level2_id,'power_tree_id') and !in_array(adminmenu($level2_id,'power_tree_id'), $powers)) and !$is_super_power}{$is_power1 = false}{/if}
                            {if $is_power1}
                            <li class="b"><a href="{url(adminmenu($level2_id,'url'))}"><i data-icon="{adminmenu($level2_id,'icon')|default:adminmenu($level1_id,'icon')}" class="fa fa-angle-right fa-lg animated"></i><cite>{adminmenu($level2_id,'title')}</cite></a></li>
                            <li class="s"><a href="{url(adminmenu($level2_id,'url'))}" class="tooltip" data-tip-text="{adminmenu($level2_id,'title')}" data-tip-bg="#009688" data-title="{adminmenu($level2_id,'title')}" data-icon="{adminmenu($level2_id,'icon')|default:adminmenu($level1_id,'icon')}"><i class="fa fa-reorder"></i></a></li>
                            {/if}
                            {/if}
                            {/foreach}
                        </ul>
                    </div>
                    {/if}
                </li>
                {/if}
                {/if}
                {/foreach}                
            </ul>
            {/if}
            {/if}
            {/foreach}
        </div>
    </div>
    
    <div id="gloRght" lay-allowClose="true">            
        <div class="layui-tab admin-nav-card" lay-filter="admin-tab" >
            <div class="topBg coverBg"></div>
            <div class="tab-bg"></div>
            <a href="javascript:void(0);" class="tab-prev"><i class="fa fa-angle-double-left fa-2x"></i></a>
            <a href="javascript:void(0);" class="tab-next"><i class="fa fa-angle-double-right fa-2x"></i></a>
			<ul class="layui-tab-title">
				<li class="layui-this">
					<i class="fa fa-desktop" aria-hidden="true"></i><cite>后台首页</cite>
				</li>
			</ul>
			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show admin_home">
                    <div class="admin_content">
                        <div class="admin_content_box">
                            <div id="admHome">
                                
                                <div class="homeRght">
                                    <div class="headimg">
                                        <a href="{url('Member/modify',['parent_id'=>$login.id])}" data-icon="fa-user" data-title="修改信息" class="new_tab"><img  src="{$root}{$login.Member.headimg|default:'images/admin/default_headimg.png'}" alt=""/></a>
                                    </div>
                                    <div class="welcome en-font">
                                        您好！<span>{$login.Member.nickname|default:$login.username}</span>                                        
                                        <a href="{url('User/logout')}" ><i style="color: red;" class="fa fa-sign-out" aria-hidden="true"></i></a>
                                    </div>
                                    <div class="time bline en-font">
                                        <b></b>
                                        <i class="fa fa-clock-o" aria-hidden="true"></i><span class="showtime">{$now|date_format:'Y-m-d H:i:s'}</span>
                                    </div>
                                    <div class="info bline en-font">
                                        真实姓名：<span class="c">{$login.Member.truename|default:'未设置'}</span>
                                    </div>
                                    <div class="info bline en-font">
                                        登录时间：<span class="c">{$login.logined}</span>
                                    </div>
                                    <div class="info bline en-font">
                                        登录地址：<span class="c">{$login.logined_ip}</span>
                                    </div>
                                    
                                    <div class="notice">                                        
                                        <div class="con">
                                            <div class="layui-btn-group skin">
                                                <a href="{url('Feedback/lists')}" class="layui-btn new_tab" data-title="留言列表" data-icon="fa-pencil-square-o">留言<span class="layui-badge layui-bg-gray">{if $count.feedback<99}{$count.feedback}{else}99+{/if}</span></a>
                                                <a class="layui-btn" onclick="layer.msg('敬请期待')">订单<span class="layui-badge layui-bg-gray">0</span></a>
                                                <a class="layui-btn" onclick="layer.msg('敬请期待')">消息<span class="layui-badge layui-bg-gray">0</span></a>
                                            </div>
                                        </div>
                                    </div>  
                                    
                                    <div class="quick">                                        
                                        <div class="con">
                                            <div class="layui-btn-group">
                                                <a href="{url('Tool/getLog')}" class="layui-btn layui-btn-primary">下载日志</a>
                                                <a href="{url('Tool/removeLog')}" class="layui-btn layui-btn-primary javascript" rel="simple_clear">清除日志</a>
                                                <a href="{url('Tool/switchTrace')}" class="layui-btn layui-btn-primary javascript" rel="switch_trace">{if config('app_trace')}关闭Trace{else}启用Trace{/if}</a>
                                            </div>
                                            <div class="layui-btn-group">
                                                <a href="{url('Tool/clearCache')}" class="layui-btn layui-btn-primary javascript" rel="simple_clear">清除缓存</a>
                                                <a href="{url('Tool/removeTemp')}" class="layui-btn layui-btn-primary javascript" rel="simple_clear" >清临时文件</a>
                                                <a href="{$dev.manual_url}" target="_blank" class="layui-btn layui-btn-primary">培训手册</a>
                                            </div>
                                            <div class="layui-btn-group">
                                                <a href="{$dev.cms_site}" class="layui-btn layui-btn-primary" target="_blank">系统官网</a>
                                                <a href="{$dev.use_url}" class="layui-btn layui-btn-primary" target="_blank">建站手册</a>
                                                <a href="{$dev.update_url}" target="_blank" class="layui-btn layui-btn-primary">检查更新</a>
                                            </div>
                                        </div>
                                    </div>                            
                                </div>
                                <div class="homeLeft">
                                    <div class="cms_count">
                                        <ul class="grid">
                                            <li class="li-1">                                                
                                                <div class="info">
                                                    <a href="{url('Article/lists')}" class="new_tab" data-title="文章列表" data-icon="fa-file-text">
                                                    <i class="icon"><img  src="{$root}images/admin/article.png" alt=""/></i>
                                                    <span class="number en-font">{if $count.article<999}{$count.article}{else}999+{/if}</span>
                                                    <span class="name">文章</span>
                                                    </a>
                                                </div>
                                                
                                            </li>
                                            <li class="li-2">
                                                <div class="info">
                                                    <a href="{url('Product/lists')}" class="new_tab" data-title="产品列表" data-icon="fa-camera">
                                                    <i class="icon"><img  src="{$root}images/admin/product.png" alt=""/></i>
                                                    <span class="number en-font">{if $count.product<999}{$count.product}{else}999+{/if}</span>
                                                    <span class="name">产品</span>
                                                    </a>
                                                </div>
                                            </li>
                                            <li class="li-3">
                                                <div class="info">
                                                    <a href="{url('Album/lists')}" class="new_tab" data-title="图集列表" data-icon="fa-image">
                                                    <i class="icon"><img  src="{$root}images/admin/album.png" alt=""/></i>
                                                    <span class="number en-font">{if $count.album<999}{$count.album}{else}999+{/if}</span>
                                                    <span class="name">图集</span>
                                                    </a>
                                                </div>
                                            </li>
                                            <li class="li-4">
                                                <div class="info">
                                                    <a href="{url('User/lists')}" class="new_tab" data-title="会员列表" data-icon="fa-user">
                                                    <i class="icon"><img  src="{$root}images/admin/user.png" alt=""/></i>
                                                    <span class="number en-font">{if $count.user<999}{$count.user}{else}999+{/if}</span>
                                                    <span class="name">会员</span>
                                                    </a>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                    
                                    <div class="cms_info clearfix">
                                        <div class="you">
                                            <div class="info">
                                                <div class="title en-font">使用者：<a href="{url('Setting/lists')}"  class="new_tab" data-title="设置列表" data-icon=" fa-gears"><i class="fa fa-pencil-square-o"></i></a></div>
                                                <div class="con">
                                                    <ul class="list">
                                                        <li><i class="fa fa-thumbs-up"></i>名称：<span>{setting('site_title')}</span></li>
                                                        <li><i class="fa fa-wifi"></i>网址：<span class="en-font"><a href="{$absroot}" target="_blank">{$absroot}</a></span></li>
                                                        <li><i class="fa fa-phone"></i>电话：<span class="en-font">{setting('tel')}</span></li>
                                                        <li><i class="fa fa-envelope"></i>邮箱：<span class="en-font">{setting('email')}</span></li>
                                                        <li><i class="fa fa-map-marker"></i> 地址：<span>{setting('address')}</span></li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="dev">
                                            <div class="info">
                                                <div class="title en-font">开发者：</div>
                                                <div class="con">
                                                    <ul class="list">                                                        
                                                        <li><i class="fa fa-thumbs-up"></i>名称：<span>{$dev.corp_title}</span></li>
                                                        <li><i class="fa fa-wifi"></i>网址：<span class="en-font"><a href="{$dev.site}" target="_blank">{$dev.site}</a></span></li>
                                                        <li><i class="fa fa-phone"></i>电话：<span class="en-font">{$dev.tel}</span></li>
                                                        <li><i class="fa fa-envelope"></i>邮箱：<span class="en-font">{$dev.email}</span></li>
                                                        <li><i class="fa fa-map-marker"></i> 地址：<span>{$dev.address}</span></li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    
                                    <div class="cms_about clearfix">                                        
                                        <div class="server">
                                            <div class="info">
                                                <div class="con">
                                                    <table class="layui-table">
                                                        <tr>
                                                            <th width="25%">存储配额限制</th>
                                                            <th width="25%">配额已使用</th> 
                                                            <th width="25%">配额续费日期</th>
                                                            <th>域名到期日期</th>                                    
                                                        </tr>
                                                        <tr>
                                                            <td>{$dev.storage_limit}</td>
                                                            <td  class="skin">
                                                                <a href="{url('Tool/getSiteSize')}" class="javascript link" rel="get_site_size">『计算』 <span id="showSiteSize" class="layui-badge layui-bg-orange">0KB</span></a>
                                                             </td>
                                                            <td>{$dev.storage_expire}</td>
                                                            <td>{$dev.domain_expire}</td>
                                                        </tr>
                                                        <tr>
                                                            <th>操作系统</th>
                                                            <th>服务器环境</th>
                                                            <th>服务器IP</th>
                                                            <th>上传最大限制</th>                                                         
                                                        </tr>
                                                        <tr>
                                                            <td>{$dev.php_os}</td>
                                                            <td>{$dev.server_software}</td>
                                                            <td>{$dev.server_name}</td>
                                                            <td>{$dev.upload_max_filesize}</td>
                                                        </tr>
                                                        
                                                        <tr>
                                                            <th>PDO支持</th>
                                                            <th>CURL支持</th>    
                                                            <th>MBstring支持</th>
                                                            <th>脚本超时时间</th>
                                                                                                                 
                                                        </tr>
                                                        <tr>
                                                            <td>{$dev.pdo_extension}</td>
                                                            <td>{$dev.curl_extension}</td>
                                                            <td>{$dev.mbstring_extension}</td>
                                                            <td>{$dev.max_execution_time}</td>
                                                        </tr>
                                                        <tr>
                                                            <th>{$dev.cms_title}版本</th>
                                                            <th>ThinkPHP版本</th>
                                                            <th>PHP版本</th>
                                                            <th>MYSQL版本</th>                                                   
                                                        </tr>
                                                        <tr>
                                                            <td>{$dev.cms_version}</td>
                                                            <td>{\App::version()}</td>
                                                            <td>{$dev.php_version}</td>
                                                            <td>{$dev.mysql_version}</td>
                                                        </tr>
                                                        
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
				</div>
			</div>
		</div>
    </div>
</div>
<div id="lockScreen" {if $is_lock_screen}style="display: block;"{/if}>
    <div class="init">
        <div class="relative">
            <div class="lockTime en-font"></div>
            <div class="pic"><img  src="{$root}{$login.Member.headimg|default:'images/admin/default_headimg.png'}" alt=""/><p class="en-font">{$login.Member.nickname|default:$login.username}</p></div>
        </div>
        <div class="wrbox">
            <input  type="password" id="screenPwd" class="wrin" value="" autocomplete="off" placeholder="请输入密码解锁.."/><br /><button id="closeLock" class="layui-btn">立即解锁</button>
        </div>
    </div>
</div>

<script type="text/javascript">
var Tab;
layui.use(['element','tab'], function(){
    var element = layui.element;
    
    layer.config({
        zIndex:10000
    });
    
    Tab = layui.tab({ 
    	elem: '.layui-tab' ,
    	maxSetting: {
    		max: 20,
    		tipMsg: '最多只能开启20个'
    	},
    	contextMenu:true,
        autoRefresh:true
    });
})

$('.gloMenu>li').each(function(){
    var childLen  = $(this).find('.navC').find('li').length;
    if(childLen) {
        var html = $(this).find('.navT').find('a').html();
         $(this).find('.navT').html('<span>'+html+'</span>') ;
    }
})

$('.gloMenu').on('click','.navT',function(){
    var parent  = $(this).closest('li');
    var index   = parent.index();
    if(parent.find('.navC').find('li').length){
        if(parent.hasClass('open')){
            parent.find('.navC').stop(true).slideUp(200,function(){ parent.removeClass('open')}) ;
        }else{
            var openLi  = $('.gloMenu').find('li.open') ;
            openLi.removeClass('open').find('.navC').stop(true).slideUp(200) ;
            parent.addClass('open').find('.navC').stop(true).slideDown(200) ;
        }
        
    }
})

$('.gloMenu').on('click','a',function(){
    //if(!$(this).hasClass('isNav')) return false ;
    var href  = $(this).attr('href');
    var title = $(this).attr('data-title') || $(this).attr('title');
    if(!title)  title=$(this).text();        
    var icon  = $(this).attr('data-icon') || $(this).find('i.fa').attr('data-icon');        
    
    
    $('.gloMenu').find('a.current').removeClass('current');
    $(this).addClass('current') ;
    
    $('#loadLine').find('i').stop(true, true).animate({
        width : '50%'
    }, 800, function(){
        var that = $(this);
        $(this).delay(200).fadeOut(200, function(){
            that.width(0).show();
        })
    })
    
    Tab.tabAdd({
        title: title,
        href : href,
        icon : icon
    })
    return false ;
})

    
$('#gloTop').find('.menuBar').click(function(){
    if($('#gloBox').hasClass('menu_close')){
        $('#gloBox').removeClass('menu_close') ;
    }else{
        $('#gloBox').addClass('menu_close') ;
    }
})

$('.skin-down').hover(function(){
    $(this).find('.skin-show').stop(true,true).slideDown(300);
},function(){
    $(this).find('.skin-show').stop(true,true).slideUp(300);
})

$('#topMenu').find('li').click(function(){
    var index = $(this).index();
    var length = $('#topMenu').find('li').length;
    if (index < length - 1) {
        $('#leftBar').find('ul.gloMenu:visible').hide().end().find('ul.gloMenu:eq('+index+')').show();
    } else {
        $('#leftBar').find('ul.gloMenu').show();
    }
    $(this).closest('#topMenu').find('li.current').removeClass('current').end().find('li:eq('+index+')').addClass('current');
    
})

function change_skin(){
    var skin  = $(this).attr('data-skin');    
    var url = "{url('Tool/set_skin')}";
    HKUC.ajax_request.call(this,url,{
            skin : skin
        },
    	{
    		'success':function(msg,data){
  		        $('#gloBox').removeClass().addClass(skin);
    		},
    		'error':function(msg,data){
                  layer.closeAll();
                  layer.msg(msg)
    		}
    	}
    );
}

function simple_clear(){
    var url = $(this).attr('href');
    HKUC.ajax_request.call(this,url,null,
    	{
    		'success':function(msg,data){
  		        layer.closeAll();
                layer.msg(msg)
    		},
    		'error':function(msg,data){
                  layer.closeAll();
                  layer.msg(msg)
    		}
    	}
    );
}

function switch_trace(){
    var url = $(this).attr('href');
    HKUC.ajax_request.call(this,url,null,
    	{
    		'success':function(msg,data){
  		        layer.closeAll();
                layer.msg(msg,{
                    time:1000,
                    end:function(){
                        window.location.reload();
                    }
                });
    		},
    		'error':function(msg,data){
                  layer.closeAll();
                  layer.msg(msg)
    		}
    	}
    );
}


function get_site_size(){
    var url = $(this).attr('href');
    layer.msg('查询中请稍后...',{ time:30*60*1000, shade :[0.01, '#393D49']});
    HKUC.ajax_request.call(this,url,null,
    	{
    		'success':function(msg,data){
                layer.closeAll();
                $('#showSiteSize').html(msg)
    		},
    		'error':function(msg,data){
                  layer.closeAll();
                  layer.msg(msg)
    		}
    	}
    );
}

function newTime(){
    var now  = new Date();
    var year = now.getFullYear() ;
    var month = (now.getMonth()+1) >=10 ? (now.getMonth()+1): '0' + (now.getMonth()+1);
    var date  = now.getDate() >=10 ? now.getDate(): '0' + now.getDate();
    var hour = now.getHours() >=10 ? now.getHours(): '0' + now.getHours();
    var minute = now.getMinutes() >=10 ? now.getMinutes(): '0' + now.getMinutes();
    var second = now.getSeconds() >=10 ? now.getSeconds(): '0' + now.getSeconds();
    var datetime = year + '-' + month + '-' + date + ' ' + hour + ':' + minute + ':' + second;
    $('.showtime').html(datetime);
    $('.lockTime').html(hour + ':' + minute + ':' + second)
}
newTime()
setInterval(newTime,1000)


//同时按下alt+L锁屏
document.onkeydown = function(event){
    if (event.keyCode == 76 && event.altKey){
        lockScreen()
    }
}


//锁屏
function lockScreen(){
    if($('#lockScreen').is(':visible')) return false ; 
    $('#screenPwd').val('');   
    $('#lockScreen').fadeIn(300, function(){
        $('#closeLock').addClass('shake');
    })
    var url = "{url('Tool/lock_screen')}";
    HKUC.ajax_request.call(this,url,null,
    	{
    		'success':function(msg,data){
  		        layer.closeAll();
    		},
    		'error':function(msg,data){
                  layer.closeAll();
                  layer.msg(msg)
    		}
    	}
    );
}

$('#screenPwd').keyup(function(event){
    if (event.keyCode == 13) {
        $('#closeLock').trigger('click');
    }
})

$('#closeLock').click(function(){
    var url = "{url('Tool/relieve_screen')}";
    var pwd = $.trim($('#screenPwd').val());
    if (!pwd) {
       layer.msg('请先输入密码'); 
       return false;
    }
    HKUC.ajax_request.call(this,url,{
            pwd : pwd
        },
    	{
    		'success':function(msg,data){
    		    layer.closeAll();
  		        $('#lockScreen').fadeOut(300);
    		},
    		'error':function(msg,data){
                  layer.closeAll();
                  layer.msg(msg);
    		}
    	}
    );
})

//resize
$(window).resize(function(){
    winWidth = $(window).width();
    heiHeght = $(window).height();
    $('#gloRght').height(heiHeght - 51);
    $('#gloLeft,#gloSLeft').css('height',(heiHeght - 51) + 'px')
    $('.layui-tab-content').height(heiHeght - 51 - 40);
    
}).trigger('resize')

//Tab
$(window).resize(function(){
    if(typeof(Tab) != 'undefined') Tab.resize();
})

$('.tab-prev').unbind('click').bind('click',function(){
    var left    = $('.layui-tab-title').position().left ;
    left  = left+117 < 0 ? left+117 : 0;
    $('.layui-tab-title').stop(true).animate({ left : left },500);
})

$('.tab-next').unbind('click').bind('click',function(){
    var left    = $('.layui-tab-title').position().left;
    var boxWid  = $('.layui-tab-title').width();
    var liWid   = 0;
    $('.layui-tab-title').children('span').remove().end().find('li').each(function(){
        liWid += $(this).outerWidth() ;
    })
    left  = left-117 > -(liWid-boxWid) ? left-117 :-(liWid-boxWid);
    if(left>0)left =  0;
    $('.layui-tab-title').stop(true).animate({ left : left },500);
})

function full_screen(){
    var docElm = document.documentElement;
    //W3C
    if (docElm.requestFullscreen) {
    docElm.requestFullscreen();
    }
    //FireFox
    else if (docElm.mozRequestFullScreen) {
    docElm.mozRequestFullScreen();
    }
    //Chrome等
    else if (docElm.webkitRequestFullScreen) {
    docElm.webkitRequestFullScreen();
    }
    //IE11
    else if (docElm.msRequestFullscreen) {
    docElm.msRequestFullscreen();
    }
}

</script>
{/block}